<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="email=no"/>
    <meta charset="UTF-8">
    <script type="text/javascript" th:src="@{${session.baseUrl}+'js/common.js'}"></script>
    <script th:src="@{${session.baseUrl}+'js/jquery.js'}"></script>
    <link th:href="@{${session.baseUrl}+'style/reset.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/base.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/header.css'}" rel="stylesheet" type="text/css">
    <link rel="stylesheet" th:href="@{${session.baseUrl}+'style/message.css'}"/>
    <title>消息</title>
</head>
<body>
<header><span onclick="javascript:history.go(-1)"></span>消息</header>
<ul id="content0">
    <li th:each="notice,iterStat:${informationNoticeList}">
        <div>
            <p th:if="${notice.status==0}"><span></span>系统消息</p>
            <p th:if="${notice.status==1}">系统消息</p>
            <a th:href="@{/wap/InformationNotice/messDetail.html/(messId=${notice.id})}">
                <p th:text="${notice.title}"></p>
            </a>
        </div>
        <p th:text="${#dates.format(notice.createTime,'yyyy-MM-dd HH:mm:ss')}"></p>
    </li>
    <div th:if="${informationNoticeList==null||informationNoticeList.size()==0}">
        <img th:src="@{${session.baseUrl}+'\images\zanwu.png'}" style="width: 8.5rem;height:5.2rem;transform: translate(0rem, 0rem);"/>
    </div>
  <!--  <li><div><p><span></span>活动通知</p><p>心意浓浓带您享受原生态新鲜</p></div><p>2016-07-05</p></li>
    <li><div><p><span></span>活动通知</p><p>心意浓浓带您享受原生态新鲜</p></div><p>2016-07-05</p></li>-->
</ul>

<script type="text/javascript" th:inline="javascript">
    var basePath = /*[[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]]*/;

    var num = 1;
    $(function () {
        $(window).scroll(
            function () {

                if ((document.documentElement.scrollHeight) == (document.documentElement.scrollTop | document.body.scrollTop) + document.documentElement.clientHeight) {
                    num = num + 1;

                    $.ajax({
                        type: "POST",
                        data: {
                            current: num,
                            memberId:/*[[${session.memberId}]]*/,
                        },
                        url: basePath + '/wap/InformationNotice/pageList',
                        cache: false,
                        /*async:true,    //true：异步，false：同步。*/
                        success: function (data) {

                            str = '';
                            $.each(data, function (index, value) {
                                str += '<li>';
                                str += '<div>';
                                if (value.status == 0) {
                                    str += '<p><span></span>系统消息</p>';
                                }else if(value.status == 1){
                                    str += '<p>系统消息</p>';
                                }
                                str += '<a href="/wap/InformationNotice/messDetail.html?messId=' + value.id + '">';
                                str += '<p>'+value.title+'</p>';
                                str += '</a>';
                                str += '</div>';
                                str += '<p>'+value.createTime+'</p>';
                                str += '</li>';
                            });
                            $("#content0").append(str); //动态加载插入HTML
                        },
                        error: function () {
                            alert("ajax请求失败");
                        }
                    })


                }
            });
    });


</script>
</body>
</html>